<?php
declare(strict_types= 1);


use app\admin\model\Category;
use app\admin\service\ArticleServiceImpl;

use function PHPUnit\Framework\assertTrue;
use think\App;


class ArticleTest extends PHPUnit\Framework\TestCase{
    public static function setUpBeforeClass(): void
    {
        $http = (new App())->http;

        $response = $http->run();
    }

    function tearDown(): void
    {
        assertTrue(true);
    }
    public function testDelete()
    {
        try {
            //code...
            $service = new ArticleServiceImpl();
            $service->delete(6);
        } catch (\Throwable $th) {
            //throw $th;
            print("error");
            print($th->getMessage());
        }
    }
    public function testEdit()
    {
        try {
            //code...
            $service = new ArticleServiceImpl();
            $service->edit(1,7,2,"bbbbbbb","aaaa/bbbb/cccc.png",['content'=>"ffffffffdddddd","vedio_path"=>"cccc/dddd.mp4"]);
        } catch (\Throwable $th) {
            //throw $th;
            print("error");
            print($th->getMessage());
        }
    }
    public function testModel()
    {
        // $model = Category::findOrEmpty(1);
        // echo class_basename($model->model); 
        // var_dump($model->model->name);
        // print($model->model->name);
        var_dump(true);
    }
    public function testAdd()
    {
        try {
            //code...
            $service = new ArticleServiceImpl();
            $service->add(1,1,"啊啊啊啊Aaaaaa","aaaa/bbbb/cccc.png",['content'=>"aaaaaabbbbbccccc"]);
        } catch (\Throwable $th) {
            //throw $th;
            print("error");
            print($th->getMessage());
        }
    }



    
}
